import {
    _get,
    _post
} from '../../../utils/request'
import util from '../../../utils/util'
import { debounce, throttle } from "../../../utils/debounce";
const app = getApp()
Page({
    data: {

        form: {},
        anomalyConditionRecord: '',
        checkoutGist: '',
        checkoutPlace: '',
        checkoutVerdict: '',
        decideGist: '',
        projectDescribe: '',
        remark: '',
        userId: app.userId
    },
    getReport() {
        _get('/myTest/getResultFace', { vbiz_id: app.test_id }).then(res => {
            console.log('报告', res);

            this.setData({
                beTestedUnit: res.data[0].beTestedUnit,

            })
        })
    },
    postConfirm: throttle(function(e) {
        let params = e.detail.value;
        params.userId = app.userId;
        params.workerOrderResultId = app.testConfirmId
        console.log('提交报告', params);
        _post(`/myTest/test_result_submit`, params).then(res => {
            console.log('提交报告成功', res);
            dd.reLaunch({
                url: '/pages/home/home'
            })
        })
    }, 2000),

    onLoad() {
        dd.setNavigationBar({
            title: '检测报告',
            backgroundColor: '#142e4f',
            success() {},
            fail() {},
        });

        this.getReport()
    },
});